<?php
$this->breadcrumbs=array(
	'Inventory Items'=>array('inventory/items'),
	"{$item->code}"=>array('item/view/id/'.$item->id),
	"Batches"
);
?>

<div class="clBoth"></div>
<h2 class='pt'>List of Item Batches</h2><a href="<?php echo $this->createUrl("inventoryBatch/create/itemId/{$item->id}"); ?>" class="butPrimary"><span>New Batch</span></a>

<div class="clBoth"></div>
<div class="action-bar">
	<div class="actions">

		<ul>
			<li><span><a href="#" onclick="return SetAction('delete')">Delete</a></span></li>
		</ul>
						
		<div class="clBoth"></div>
	</div>
</div>

<table class="index">	
	<thead>
		<tr>
			<th width="40" align="center">
				<input type="checkbox" name="check" class="checkbox" onclick="return Check_Uncheck(this, 'invoice[]')">
			</th>
			<th align="left" width='50'><a href="">Batch Id</a></th>
			<th align="left" width='80'><a href="">Location</a></th>
			<th align="left" width='120'><a href="">Origination</a></th>
			<th align="right" width='80'><a href="">Quantity</a></th>
			<th align="right" style="padding-right: 5px;" width='80'><a href="">Unit Cost</a></th>
			<th align="right" width='150'><a href="">Date Recorded</a></th>
		</tr>
	
	</thead>

	<tbody>
		<?php foreach ($batches as $batch) : ?>
			<tr>
				<td align='center' style="vertical-align:middle"><input class="checkbox" type='checkbox' name='item[]' value='<?php echo $batch->id; ?>'></td>
				<td style="vertical-align:middle"><a href="<?php echo $this->createUrl("item/batchDetails/id/{$batch->id}"); ?>" ><?php echo $batch->id; ?></a></td>
				<td style="vertical-align:middle"><?php echo $batch->location->code; ?></td>
				
				<td style="vertical-align:middle"><a href="<?php echo $this->createUrl("purchaseOrder/view/id/{$batch->model_id}"); ?>" ><?php echo $batch->model; ?></a></td>
				<td align="right" style="vertical-align:middle"><?php echo $batch->quantity; ?></td>
				<td align="right" style="vertical-align:middle; padding-right: 5px;"><?php echo number_format($batch->unit_cost, 2); ?></td>
				<td align="right"><?php echo $batch->date_created; ?></td>
			</tr>
		<?php endforeach; ?>
	    

	</tbody>
</table>			